﻿using QYmall.Core.Common.Emum;
using QYmall.Core.Common.Helper;
using QYmall.Core.Model.Models;
using QYmall.Core.Model.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace QYmall.Core.IServices
{
    /// <summary>
    /// 商户收藏关注接口
    /// </summary>
    public interface IMerchantFavoriteService : IBaseService
    {
        /// <summary>
        /// 查询一条记录
        /// </summary>
        Task<MerchantFavorite?> QueryAsync(Expression<Func<MerchantFavorite, bool>> funcWhere, WriteRoRead writeAndRead = WriteRoRead.Read);

        /// <summary>
        /// 查询前几条数据
        /// </summary>
        Task<IEnumerable<MerchantFavorite>> QueryListAsync(int top, Expression<Func<MerchantFavorite, bool>> funcWhere,
            string orderBy, WriteRoRead writeAndRead = WriteRoRead.Read);

        /// <summary>
        /// 查询分页列表
        /// </summary>
        Task<PaginationList<MerchantFavorite>> QueryPageAsync(int pageSize, int pageIndex, Expression<Func<MerchantFavorite, bool>> funcWhere,
            string orderBy, WriteRoRead writeAndRead = WriteRoRead.Read);

        /// <summary>
        /// 获取关注会员分页列表
        /// </summary>
        Task<PaginationList<MerchantFavoriteMemberDto>> QueryMemberPageAsync(int pageSize, int pageIndex,
            Expression<Func<MerchantFavoriteMemberDto, bool>> funcWhere, string orderBy, WriteRoRead writeAndRead = WriteRoRead.Read);

        /// <summary>
        /// 添加一条记录
        /// </summary>
        Task<MerchantFavoriteDto> AddAsync(MerchantFavoriteEditDto modelDto, WriteRoRead writeAndRead = WriteRoRead.Write);

        /// <summary>
        /// 根据条件删除记录
        /// </summary>
        Task<bool> DeleteAsync(Expression<Func<MerchantFavorite, bool>> funcWhere, WriteRoRead writeAndRead = WriteRoRead.Write);
    }
}
